home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 August / DPPCPRO0805.ISO / Assets / Interface / Main.dxr / Flash Components_1_Centre pane.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-05-20  |  15.5 KB  |  391 lines

  1. function disableControls()
  2. {
  3.    pageMgr.enabled = false;
  4. }
  5. function enableControls()
  6. {
  7.    pageMgr.enabled = true;
  8. }
  9. function showCredits()
  10. {
  11.    _level0.pageMgr.removePage();
  12.    _level0.entries._visible = false;
  13.    trace("Going to credits");
  14.    _level0.sections.selectedIndex = undefined;
  15.    _level0.pageMgr.buildPage(4,{});
  16. }
  17. function showPage(pageName, pageBody)
  18. {
  19.    _level0.pageMgr.removePage();
  20.    _level0.entries._visible = false;
  21.    _level0.listSeparator2._visible = false;
  22.    _level0.pageMgr.setLocation(165,0);
  23.    _level0.entries.visible = false;
  24.    _level0.pageMgr.buildPage(3,{label:pageName,maindesc:pageBody});
  25.    _level0.sections.selectedIndex = undefined;
  26. }
  27. function contentDone()
  28. {
  29.    gotoAndStop("fadeToWelcome");
  30.    play();
  31. }
  32. function setSection(secName)
  33. {
  34.    dataSource.push({label:secName,data:[]});
  35. }
  36. function setFooterPage(pageTitle, pageBody)
  37. {
  38.    footerPages.push({label:pageTitle,data:pageBody});
  39. }
  40. function setApp(secNum, appName, fullTitle)
  41. {
  42.    var _loc1_ = dataSource[secNum - 1].data.push({label:appName,data:{}});
  43.    if(fullTitle != undefined)
  44.    {
  45.       dataSource[secNum - 1].data[_loc1_ - 1].fulltitle = fullTitle;
  46.    }
  47. }
  48. function setSectionColour(secNum, colAttrName, colValue)
  49. {
  50.    if(dataSource[secNum - 1].colours == undefined)
  51.    {
  52.       dataSource[secNum - 1].colours = new mx.styles.CSSStyleDeclaration();
  53.    }
  54.    var _loc1_ = colValue.split(",");
  55.    var _loc2_ = "0x" + Number(_loc1_[0]).toString(16) + Number(_loc1_[1]).toString(16) + Number(_loc1_[2]).toString(16);
  56.    dataSource[secNum - 1].colours[colAttrName] = _loc2_;
  57. }
  58. function setHighlight(secNum, hlNum, hlTitle, hlDesc, entryNum, hlImage)
  59. {
  60.    if(dataSource[secNum - 1].highlights == undefined)
  61.    {
  62.       dataSource[secNum - 1].highlights = new Array();
  63.    }
  64.    dataSource[secNum - 1].highlights.push({title:hlTitle,desc:hlDesc,target:entryNum - 1,imagePath:hlImage});
  65. }
  66. function setUpdate(secNum, entryNum, entryTitle)
  67. {
  68.    if(dataSource[secNum - 1].updates == undefined)
  69.    {
  70.       dataSource[secNum - 1].updates = new Array();
  71.    }
  72.    dataSource[secNum - 1].updates.push({label:entryTitle,target:entryNum - 1});
  73. }
  74. function setSectionAttribute(secNum, attrName, attrValue)
  75. {
  76.    dataSource[secNum - 1][attrName] = attrValue;
  77. }
  78. function setAppAttribute(secNum, appNum, attrName, attrValue)
  79. {
  80.    dataSource[secNum - 1].data[appNum - 1].data[attrName] = attrValue;
  81. }
  82. function setSimpleLink(secNum, appNum, linkLabel, linkTarget)
  83. {
  84.    if(dataSource[secNum - 1].data[appNum - 1].data.links == undefined)
  85.    {
  86.       dataSource[secNum - 1].data[appNum - 1].data.links = new Array();
  87.    }
  88.    dataSource[secNum - 1].data[appNum - 1].data.links.push({label:linkLabel,target:linkTarget});
  89. }
  90. function setComplexLink(secNum, appNum, linkNum, linkLabel)
  91. {
  92.    if(dataSource[secNum - 1].data[appNum - 1].data.links == undefined)
  93.    {
  94.       dataSource[secNum - 1].data[appNum - 1].data.links = new Array();
  95.    }
  96.    dataSource[secNum - 1].data[appNum - 1].data.links.push({label:linkLabel,linkNum:linkNum});
  97. }
  98. function setStep(secNum, appNum, linkNum, stepDesc, stepLabel, stepTarget)
  99. {
  100.    if(dataSource[secNum - 1].data[appNum - 1].data.links[linkNum - 1] == undefined)
  101.    {
  102.       dataSource[secNum - 1].data[appNum - 1].data.links[linkNum - 1] = new Array();
  103.    }
  104.    dataSource[secNum - 1].data[appNum - 1].data.links[linkNum - 1].data.push({label:stepLabel,description:stepDesc,target:stepTarget});
  105. }
  106. function showData()
  107. {
  108.    var _loc2_ = 0;
  109.    while(_loc2_ < dataSource.length)
  110.    {
  111.       var _loc3_ = dataSource[_loc2_].label;
  112.       var _loc1_ = 0;
  113.       while(_loc1_ < dataSource[_loc2_].data.length)
  114.       {
  115.          for(prop in dataSource[_loc2_].data[_loc1_].data)
  116.          {
  117.             if(typeof dataSource[_loc2_].data[_loc1_].data[prop] == "object")
  118.             {
  119.                showObject(dataSource[_loc2_].data[_loc1_].data[prop],1);
  120.             }
  121.          }
  122.          _loc1_ = _loc1_ + 1;
  123.       }
  124.       _loc2_ = _loc2_ + 1;
  125.    }
  126. }
  127. function showObject(theObj, nestLevel)
  128. {
  129.    for(prop in theObj)
  130.    {
  131.       if(typeof theObj[prop] == "object")
  132.       {
  133.          showObject(theObj[prop],nestLevel + 1);
  134.       }
  135.       else
  136.       {
  137.          var _loc2_ = nestLevel * 2;
  138.          indentText = "";
  139.          var _loc1_ = 0;
  140.          while(_loc1_ < _loc2_)
  141.          {
  142.             indentText += " ";
  143.             _loc1_ = _loc1_ + 1;
  144.          }
  145.       }
  146.    }
  147. }
  148. function getHeadlineHeight(taText, taWidth)
  149. {
  150.    var _loc1_ = new TextFormat();
  151.    _loc1_.font = "embed_MetaMediumLF-Roman";
  152.    _loc1_.size = 28;
  153.    _loc1_.bold = _loc1_.italic = _loc1_.underline = _loc1_.bullet = false;
  154.    _loc1_.align = "left";
  155.    _loc1_.leading = 12;
  156.    var _loc2_ = _loc1_.getTextExtent(taText,taWidth);
  157.    return _loc2_.textFieldHeight;
  158. }
  159. function getSizeFromString(size)
  160. {
  161.    var _loc5_ = "0".charCodeAt(0);
  162.    var _loc4_ = "9".charCodeAt(0);
  163.    var _loc1_ = undefined;
  164.    _loc1_ = 0;
  165.    while(_loc1_ < size.length - 1)
  166.    {
  167.       var _loc2_ = size.charCodeAt(_loc1_);
  168.       if(_loc2_ < _loc5_ || fontSize.charCodeAt > _loc4_)
  169.       {
  170.          break;
  171.       }
  172.       _loc1_ = _loc1_ + 1;
  173.    }
  174.    return Number(size.substring(0,_loc1_ - 1));
  175. }
  176. function styleSheetToTextFormat(myStyle)
  177. {
  178.    var _loc1_ = new TextFormat();
  179.    _loc1_.font = myStyle.fontFamily;
  180.    _loc1_.size = getSizeFromString(myStyle.fontSize);
  181.    _loc1_.align = myStyle.textAlign;
  182.    return _loc1_;
  183. }
  184. function showObjectSummary(theObject, thePath)
  185. {
  186.    trace("Object summary for: " + thePath);
  187.    trace("-------------------");
  188.    for(prop in theObject)
  189.    {
  190.       var _loc1_ = prop;
  191.       var _loc2_ = theObject[_loc1_];
  192.       trace(_loc1_ + " : " + _loc2_);
  193.    }
  194.    trace("");
  195. }
  196. function replaceAll(oldStr, oldToken, newToken)
  197. {
  198.    trace("oldStr: " + oldStr);
  199.    var _loc3_ = 0;
  200.    var _loc5_ = 0;
  201.    var _loc2_ = new String();
  202.    trace("New text is " + _loc2_);
  203.    var _loc1_ = undefined;
  204.    trace("startIndex: " + _loc3_);
  205.    trace("length of oldStr: " + oldStr.length);
  206.    trace("newStr before while loop: " + _loc2_);
  207.    trace("");
  208.    while(_loc3_ < oldStr.length)
  209.    {
  210.       _loc1_ = oldStr.indexOf(oldToken,_loc3_);
  211.       trace("--- start of loop iteration ---");
  212.       trace("foundAt: " + _loc1_);
  213.       trace("newStr was: " + _loc2_);
  214.       if(_loc1_ == _loc3_)
  215.       {
  216.          trace("BRANCH 1");
  217.          _loc2_ = _loc2_.concat(newToken);
  218.          _loc3_ = _loc1_ + 1;
  219.          _loc5_ = _loc1_ + 1;
  220.       }
  221.       else
  222.       {
  223.          if(_loc1_ == -1)
  224.          {
  225.             trace("BRANCH 3");
  226.             _loc2_ = _loc2_.concat(oldStr.substring(_loc3_,oldStr.length));
  227.             break;
  228.          }
  229.          trace("BRANCH 2");
  230.          _loc2_ = _loc2_.concat(oldStr.substring(_loc3_,_loc1_),newToken);
  231.          _loc3_ = _loc1_ + 1;
  232.          _loc5_ = _loc1_ + 1;
  233.       }
  234.       trace("newStr now is: " + _loc2_);
  235.       trace("--- end of loop iteration ---");
  236.       trace("");
  237.    }
  238.    trace("New text is " + _loc2_);
  239.    return _loc2_;
  240. }
  241. var loadingBarStyle = _global.styles.loadingBarStyle = new mx.styles.CSSStyleDeclaration();
  242. loadingBarStyle.themeColor = "0x990000";
  243. loadingBarStyle.embedFonts = true;
  244. loadingBarStyle.fontFamily = "embed_MetaBoldLF-Caps";
  245. loadingBarStyle.fontSize = 14;
  246. _level0.loadingBar.pBar.setStyle("styleName","loadingBarStyle");
  247. var boxTitleStyle = _global.styles.boxTitleStyle = new mx.styles.CSSStyleDeclaration();
  248. boxTitleStyle.styleName = "boxTitleStyle";
  249. boxTitleStyle.textAlign = "left";
  250. boxTitleStyle.borderStyle = "none";
  251. boxTitleStyle.backgroundColor = undefined;
  252. boxTitleStyle.selectionDisabledColor = "0xB8C5CC";
  253. boxTitleStyle.disabledColor = "0xDCDCDC";
  254. boxTitleStyle.fontWeight = "normal";
  255. boxTitleStyle.textDecoration = "none";
  256. var boxDescStyle = _global.styles.boxDescStyle = new mx.styles.CSSStyleDeclaration();
  257. boxDescStyle.styleName = "boxDescStyle";
  258. boxDescStyle.textAlign = "left";
  259. boxDescStyle.borderStyle = "none";
  260. boxDescStyle.backgroundColor = undefined;
  261. boxDescStyle.selectionDisabledColor = "0xB8C5CC";
  262. boxDescStyle.disabledColor = "0xDCDCDC";
  263. boxDescStyle.fontWeight = "normal";
  264. boxDescStyle.textDecoration = "none";
  265. var secListStyle = _global.styles.secListStyle = new mx.styles.CSSStyleDeclaration();
  266. secListStyle.styleName = "secListStyle";
  267. secListStyle.textAlign = "left";
  268. secListStyle.marginLeft = 6;
  269. secListStyle.borderStyle = "none";
  270. secListStyle.fontFamily = "embed_MetaMediumLF-Roman";
  271. secListStyle.fontSize = 14;
  272. secListStyle.rowHeight = "auto";
  273. secListStyle.color = "0x444444";
  274. secListStyle.backgroundColor = "0xFFFFFF";
  275. secListStyle.textSelectedColor = "0xFFFFFF";
  276. secListStyle.selectionColor = "0x990000";
  277. secListStyle.textRollOverColor = "0x00396B";
  278. secListStyle.rollOverColor = "0xCCCCBC";
  279. secListStyle.disabledColor = "0x8FA7B3";
  280. secListStyle.selectionDisabledColor = "0xB8C5CC";
  281. var entListStyle = _global.styles.entListStyle = new mx.styles.CSSStyleDeclaration();
  282. entListStyle.styleName = "entListStyle";
  283. entListStyle.textAlign = "left";
  284. entListStyle.marginLeft = 6;
  285. entListStyle.borderStyle = "none";
  286. entListStyle.fontFamily = "embed_MetaMediumLF-Roman";
  287. entListStyle.fontSize = 14;
  288. entListStyle.rowHeight = "auto";
  289. entListStyle.themeColor = "0x990000";
  290. entListStyle.color = "0x444444";
  291. entListStyle.backgroundColor = "0xFFFFFF";
  292. entListStyle.textSelectedColor = "0xFFFFFF";
  293. entListStyle.selectionColor = "0x990000";
  294. entListStyle.textRollOverColor = "0x00396B";
  295. entListStyle.rollOverColor = "0xCCCCBC";
  296. entListStyle.disabledColor = "0x8FA7B3";
  297. entListStyle.selectionDisabledColor = "0xB8C5CC";
  298. var footerListStyle = _global.styles.footerListStyle = new mx.styles.CSSStyleDeclaration();
  299. footerListStyle.styleName = "footerListStyle";
  300. footerListStyle.textAlign = "left";
  301. footerListStyle.borderStyle = "solid";
  302. footerListStyle.backgroundColor = undefined;
  303. footerListStyle.color = "0x444444";
  304. footerListStyle.themeColor = "0x005BAB";
  305. footerListStyle.rollOverColor = "0xCFDEE5";
  306. footerListStyle.textRollOverColor = "0xFFFFFF";
  307. footerListStyle.textSelectedColor = "0xFFFFFF";
  308. footerListStyle.selectionColor = "0x005BAB";
  309. footerListStyle.selectionDisabledColor = "0xB8C5CC";
  310. footerListStyle.disabledColor = "0x8FA7B3";
  311. footerListStyle.fontFamily = "embed_Bliss2";
  312. footerListStyle.fontSize = 12;
  313. var headlineStyle = _global.styles.headlineStyle = new mx.styles.CSSStyleDeclaration();
  314. headlineStyle.styleName = "headlineStyle";
  315. headlineStyle.textAlign = "left";
  316. headlineStyle.backgroundColor = undefined;
  317. headlineStyle.color = "0x000000";
  318. headlineStyle.selectionDisabledColor = "0xB8C5CC";
  319. headlineStyle.disabledColor = "0xDCDCDC";
  320. headlineStyle.fontFamily = "embed_MetaMediumLF-Roman";
  321. headlineStyle.fontSize = 28;
  322. headlineStyle.fontWeight = "normal";
  323. headlineStyle.leading = 12;
  324. headlineStyle.textDecoration = "none";
  325. var appTitleStyle = _global.styles.appTitleStyle = new mx.styles.CSSStyleDeclaration();
  326. appTitleStyle.styleName = "appTitleStyle";
  327. appTitleStyle.textAlign = "left";
  328. appTitleStyle.borderStyle = "none";
  329. appTitleStyle.color = "0x000000";
  330. appTitleStyle.backgroundColor = undefined;
  331. appTitleStyle.selectionDisabledColor = "0xB8C5CC";
  332. appTitleStyle.disabledColor = "0x8FA7B3";
  333. appTitleStyle.fontFamily = "embed_MetaBoldLF-Roman";
  334. appTitleStyle.fontSize = 28;
  335. appTitleStyle.fontWeight = "normal";
  336. appTitleStyle.textDecoration = "none";
  337. var bodyStyle = _global.styles.bodyStyle = new mx.styles.CSSStyleDeclaration();
  338. bodyStyle.styleName = "bodyStyle";
  339. bodyStyle.borderStyle = "none";
  340. bodyStyle.backgroundColor = undefined;
  341. bodyStyle.selectionDisabledColor = "0xB8C5CC";
  342. bodyStyle.disabledColor = "0xDCDCDC";
  343. var buttonStyle = _global.styles.buttonStyle = new mx.styles.CSSStyleDeclaration();
  344. buttonStyle.styleName = "buttonStyle";
  345. buttonStyle.themeColor = "0x990000";
  346. buttonStyle.color = "0x444444";
  347. buttonStyle.disabledColor = "0xDCDCDC";
  348. buttonStyle.fontFamily = "embed_MetaBoldLF-Caps";
  349. buttonStyle.fontSize = 13;
  350. buttonStyle.fontWeight = buttonStyle.fontStyle = "normal";
  351. var scrollTextAreaStyle = _global.styles.scrollTextAreaStyle = new mx.styles.CSSStyleDeclaration();
  352. scrollTextAreaStyle.styleName = "scrollTextAreaStyle";
  353. scrollTextAreaStyle.themeColor = "0x990000";
  354. scrollTextAreaStyle.disabledColor = "0xDCDCDC";
  355. scrollTextAreaStyle.fontFamily = "embed_MetaMediumLF-Roman";
  356. var entListScrollBar = _global.styles.entListScrollBar = new mx.styles.CSSStyleDeclaration();
  357. entListScrollBar.styleName = "entListScrollBar";
  358. entListScrollBar.themeColor = "0x990000";
  359. _global.styles.TextArea.setStyle("backgroundColor",undefined);
  360. _global.textStyles = new TextField.StyleSheet();
  361. textStyles.setStyle("headline",{fontFamily:"embed_KnockoutHTF69FullLiteweight",fontSize:"36px",color:"#000000",textDecoration:"none",textAlign:"left",fontWidth:"normal",leading:"-25"});
  362. textStyles.setStyle("headlinedisabled",{fontFamily:"embed_KnockoutHTF69FullLiteweight",fontSize:"36px",color:"#DCDCDC",textDecoration:"none",textAlign:"left",fontWidth:"normal",leading:"-25"});
  363. textStyles.setStyle("pagetitle",{fontFamily:"embed_KnockoutHTF69FullLiteweight",fontSize:"22px",color:"#000000",textDecoration:"none"});
  364. textStyles.setStyle("pagedesc",{fontFamily:"embed_Bliss2",fontSize:"16px",fontWeight:"normal",color:"#000000",textDecoration:"none"});
  365. textStyles.setStyle("boxtitle",{fontFamily:"embed_KnockoutHTF69FullLiteweight",fontSize:"27px",color:"#000000",textDecoration:"none"});
  366. textStyles.setStyle("boxdesc",{fontFamily:"embed_Bliss2",fontSize:"15px",color:"#000000",textDecoration:"none",display:"inline"});
  367. textStyles.setStyle("columnboldwhite",{fontFamily:"embed_Arial_Black",fontSize:"12px",fontWeight:"normal",color:"#FFFFFF",textDecoration:"none",textAlign:"left"});
  368. textStyles.setStyle("columnboldwhitedisabled",{fontFamily:"embed_Arial_Black",fontSize:"12px",fontWeight:"normal",color:"#A8A8A8",textDecoration:"none",textAlign:"left"});
  369. textStyles.setStyle("columnboldgrey",{fontFamily:"embed_Arial_Black",fontSize:"12px",fontWeight:"normal",color:"#666666",textDecoration:"none",textAlign:"left"});
  370. textStyles.setStyle("columnboldgreydisabled",{fontFamily:"embed_Arial_Black",fontSize:"12px",fontWeight:"normal",color:"#DCDCDC",textDecoration:"none",textAlign:"left"});
  371. textStyles.setStyle("column",{fontFamily:"embed_Bliss2",fontSize:"14px",color:"#000000",textDecoration:" none",textAlign:"left"});
  372. textStyles.setStyle("pagebody",{fontFamily:"embed_Bliss2",fontSize:"16px",color:"#000000",borderStyle:"none",textDecoration:"none",textAlign:"left"});
  373. textStyles.setStyle("pagebodybold",{fontFamily:"embed_Bliss2",fontSize:"16px",color:"#000000",borderStyle:"none",textDecoration:"none",textAlign:"left"});
  374. textStyle.setStyle("subheading",{fontFamily:"embed_MetaBoldLF-Roman",fontSize:"13px",color:"#000000",borderStyle:"none",textDecoration:"none",textAlign:"left"});
  375. textStyles.setStyle("footerbody",{fontFamily:"Embedded_Arial",fontSize:"10px",fontWeight:"normal",color:"#000000",textDecoration:"none",textAlign:"left"});
  376. textStyles.setStyle(".hyperlink",{textDecoration:"underline"});
  377. textStyles.setStyle(".desclink",{color:"#0000FF"});
  378. textStyles.setStyle(".boxtitlelink",{color:"#FFFF00"});
  379. textStyles.setStyle(".underlined",{textDecoration:"underline"});
  380. textStyles.setStyle("a:link",{color:"#005BAB",textDecoration:"none"});
  381. textStyles.setStyle("a:hover",{color:"#E50000",textDecoration:"underline"});
  382. textStyles.setStyle("a:active",{color:"#005BAB",textDecoration:"underline"});
  383. var dataSource = new Array();
  384. var footerPages = new Array();
  385. var __nextDepth = 10;
  386. var pageMgr = new PageManager();
  387. pageMgr.setLocation(350,0);
  388. var titleFormat = _level0.styleSheetToTextFormat(_global.textStyles.getStyle("headline"));
  389. showObjectSummary(titleFormat,"_level0.titleFormat");
  390. stop();
  391.